home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 7
/
Aminet 7 - August 1995.iso
/
Aminet
/
comm
/
mebbs
/
rfscd101.lha
/
RFSCD.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1994-11-09
|
14KB
|
430 lines
/***********************************
* *
* RFS CD Version 1.01 *
* by Steve Robbins [M3014] *
* RFS Software *
* Last updated 10 Nov 94 *
* *
***********************************/
options results
parse arg LineNumber
if ~show('L','rexxsupport.library') then do
if addlib('rexxsupport.library',0,-30,0) then NOP
else do
say 'Rexxsupport.library is not available'
exit 10
end
end
if( ~show( 'l', "mebbsarexx.library" ) )then do
if( ~addlib( "mebbsarexx.library", 0, -30, 0 ) )then do
say "Could not open library"
exit 10
end
end
parse arg LineNumber
signal on syntax
signal on ioerr
DoorName = "RFSCD"
curCD = "Please select a CD first"
/*********************** Sysop defined variables **********************/
i = 4 /* Total amount of paths allowed */
path.1 = "AmiNet_0693:AmiNet" /* Path */
pathname.1 = "AmiNet#1 * Available on request *" /* On-Line Name */
pathacc.1 = "0" /* Access */
path.2 = "AmiNet_0294:AmiNet" /* Path */
pathname.2 = "AmiNet#2 * Available Mondays - Thursdays *" /* On-Line Name */
pathacc.2 = "0" /* Access */
path.3 = "GoldFish1-Apr94:bbs" /* Path */
pathname.3 = "Gold Fish * Available Fridays - Sundays *" /* On-Line Name */
pathacc.3 = 0 /* Access */
path.4 = "BBS:Files" /* Path */
pathname.4 = "On-Line Files * Available always *" /* On-Line Name */
pathacc.4 = 31 /* Access */
helpfile = "BBS:Rexx/RFSCD.help"
/****************** End of Sysop defined variables ********************/
call GETVAR DoorName, LineNumber, 20
access = result
call GETVAR DoorName, LineNumber, 10
lines = result
call GETVAR DoorName, LineNumber, 8
ansiflag = result
if ansiflag > 1 then ansiflag = 1
if ansiflag then do
MENCOL = '
'
WHITE = '
'
RED = '
'
YELLOW ='
'
BLACK = '
'
GREEN = '
'
CYAN = '
'
MAGENTA = '
'
BLUE = '
'
CLEAR = ''
HOM = 'H'
end
else do
MENCOL = ''
WHITE = ''
RED = ''
YELLOW =''
BLACK = ''
GREEN = ''
CYAN = ''
MAGENTA = ''
BLUE = ''
CLEAR = ''
HOM = ''
end
CLS = 'H'
spaces = " "
call message DoorName, LineNumber, CLS, 1
call message DoorName, LineNumber, " "MENCOL"ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"CLEAR, 1
call message DoorName, LineNumber, " "MENCOL"º º"CLEAR, 1
call message DoorName, LineNumber, " "MENCOL"º
RFS-CD Version 1.01 "MENCOL"º"CLEAR, 1
call message DoorName, LineNumber, " "MENCOL"º º"CLEAR, 1
call message DoorName, LineNumber, " "MENCOL"º
by Steve Robbins [M3014] "MENCOL"º"CLEAR, 1
call message DoorName, LineNumber, " "MENCOL"º º"CLEAR, 1
call message DoorName, LineNumber, " "MENCOL"º
RFS Software "MENCOL"º"CLEAR, 1
call message DoorName, LineNumber, " "MENCOL"º º"CLEAR, 1
call message DoorName, LineNumber, " "MENCOL"º
Copyright 1994 "MENCOL"º"CLEAR, 1
call message DoorName, LineNumber, " "MENCOL"º º"CLEAR, 1
call message DoorName, LineNumber, " "MENCOL"ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"CLEAR, 1
call message DoorName, LineNumber, CLEAR, 1
call hotkey DoorName, LineNumber, "Return..."
call message DoorName, LineNumber, CLS, 1
call message DoorName, LineNumber, YELLOW" Type ? or Help to get the available commands", 1
call message DoorName, Linenumber, "", 1
main:
call prompt DoorName, LineNumber, CYAN""curCD""BLUE" > "YELLOW, 36
ans = result
call checkcarrier
if upper(ans) = "Q" then signal quit
if upper(ans) = "QUIT" then signal quit
if upper(ans) = "EXIT" then signal quit
if upper(ans) = "S" then signal select
if upper(ans) = "SELECT" then signal select
if upper(word(ans, 1)) = "CD" then signal newdirs
if upper(word(ans, 1)) = "D" then signal dload
if upper(word(ans, 1)) = "DOWNLOAD" then signal dload
if upper(word(ans, 1)) = "R" then signal readfile1
if upper(word(ans, 1)) = "READ" then signal readfile1
if upper(ans) = "DIR" then signal dirall
if upper(ans) = "LS" then signal listall
if upper(ans) = "?" then signal help
if upper(ans) = "HELP" then signal help
if upper(ans) = "CLS" then do
call message DoorName, LineNumber, CLS, 1
signal main
end
if upper(ans) = ":" then do
curCD = top
signal main
end
else do
call message DoorName, LineNumber, "", 1
call message DoorName, LineNumber, RED"Invalid selection!", 1
address command "wait 1"
signal main
end
call hotkey DoorName, LineNumber, "Return..."
call checkcarrier
call Exit_Door DoorName, LineNumber
exit
end
help:
call message DoorName, LineNumber, CLS, 1
call readfile DoorName, LineNumber, helpfile
call message DoorName, LineNumber, CLEAR, 1
signal main
newdirs:
if curCD == "Please select a CD first" then do
call message DoorName, LineNumber, "", 1
call message DoorName, LineNumber, RED"You must select a CD first!", 1
address command "wait 1"
signal main
end
if word(ans, 2) == ":" then do
curcd = path.curselection
signal main
end
if word(ans, 2) == "/" then do
if curcd == top then do
call message DoorName, LineNumber, RED"You are not allowed in the parent directory!", 1
signal main
end
if pos("/",curcd) ~= 0 then curcd = left(curcd, lastpos("/", curcd) - 1)
else curcd = left(curcd, lastpos(":", curcd))
signal main
end
if index(word(ans, 2), "//") ~= 0 || index(ans, ":") ~= 0 then do
call message DoorName, LineNumber, "", 1
call message DoorName, LineNumber, RED"Invalid directory path!", 1
address command "wait 1"
signal main
end
alldirs = ShowDir(curCD, 'Dir')
totdirs = words(alldirs)
j = 0
if totdirs > 0 then do p = 1 to totdirs
tempdirs.p = word(alldirs, p)
if Upper(word(ans, 2)) == upper(tempdirs.p) then do
j = 1
p = totdirs
end
end
if right(curcd,1) ~= ":" then slash = "/"
else slash = ""
if j = 0 then call message DoorName, LineNumber, RED"Invalid directory!", 1
if j = 1 then curcd = curcd || slash || word(ans, 2)
call message DoorName, LineNumber, "", 1
call checkcarrier
signal main
readfile1:
if curCD == "Please select a CD first" then do
call message DoorName, LineNumber, "", 1
call message DoorName, LineNumber, RED"You must select a CD first!", 1
address command "wait 1"
signal main
end
rfile = upper(word(ans, 2))
if right(curcd,1) ~= ":" then slash = "/"
else slash = ""
rfile1 = curCD || slash || rfile
if ~Exists(rfile1) then do
call message DoorName, LineNumber, "", 1
call message DoorName, LineNumber, RED"The file does not exist!", 1
address command "wait 1"
signal main
end
r = 0
call open(testme, rfile1, 'R')
call seek(testme, 0, 'B')
do f = 1 to 20
TestCh = readch(testme, 1)
if C2D(TestCh) > 127 then r = 1
end
call close(rfile1)
if r == 1 then do
call message DoorName, LineNumber, "", 1
call message DoorName, LineNumber, RED"Not a recognized text file!", 1
address command "wait 1"
signal main
end
call message DoorName, LineNumber, WHITE, 0
call readfile DoorName, LineNumber, rfile1
call hotkey DoorName, LineNumber, GREEN"Hit Return To Continue..."
call message DoorName, LineNumber, "", 1
signal main
select:
call message DoorName, LineNumber, CLS, 1
call message DoorName, LineNumber, "", 1
call message DoorName, LineNumber, "", 1
call message DoorName, LineNumber, "", 1
call message DoorName, LineNumber, "", 1
call message DoorName, LineNumber, BLUE"CD's that are available to you:", 1
do j = 1 to i
if access >= pathacc.j then call message DoorName, LineNumber, CYAN j". "PathName.j, 1
end
call prompt DoorName, LineNumber, GREEN"Please select a CD > ", 2
curselection = result
curCD = Path.curselection
call checkcarrier
f = 0
testdir = left(curcd,(pos(":",curcd))-1) || " [Mounted]"
address command "info >t:RFSCD_Output_"||LineNumber
call open(info, 'T:RFSCD_Output_' || LineNumber, 'R')
do until EOF(info)
junk = readln(info)
if upper(testdir) == Upper(junk) then f = 1
end
call close(info)
if f == 0 then do
call message DoorName, LineNumber, RED"That directory is currently not available", 1
curCD = "Please select a CD first"
address command "wait 1"
call message DoorName, LineNumber, CLS, 1
call message DoorName, LineNumber, "", 1
signal main
end
call close(info)
address command "delete t:RFSCD_Output quiet"
top = curCD
call message DoorName, LineNumber, CLS, 1
call message DoorName, LineNumber, "", 1
signal main
dirall:
if curCD == "Please select a CD first" then do
call message DoorName, LineNumber, "", 1
call message DoorName, LineNumber, RED"You must select a CD first!", 1
address command "wait 1"
signal main
end
alldirs = ShowDir(curCD, 'Dir')
totdirs = words(alldirs)
w = 1
if totdirs > 0 then do p = 1 to totdirs
tempdirs.p = overlay(word(alldirs, p), spaces)
call message DoorName, LineNumber, tempdirs.p, 0
if w // 3 = 0 then call message DoorName, LineNumber, "", 1
if w // (LINES * 3) = 0 then do
if w // 3 ~= 0 then call message DoorName, LineNumber, "", 1
call hotkey DoorName, LineNumber, GREEN 'Hit Q to Quit or Any Other Key to Continue...'YELLOW
ans = upper(result)
call checkcarrier
if ans = 'Q' then do
call message DoorName, LineNumber, "", 1
signal main
end
call message DoorsName, LineNumber, "", 1
end
w = w + 1
end
w = 1
call message DoorName, LineNumber, MAGENTA, 1
allfiles = ShowDir(curCD, 'File')
totfiles = words(allfiles)
if totfiles > 0 then do p = 1 to totfiles
tempfiles.p = overlay(word(allfiles, p), spaces)
call message DoorName, LineNumber, tempfiles.p, 0
if w // 3 = 0 then call message DoorName, LineNumber, "", 1
if w // (LINES * 3) = 0 then do
if w // 3 ~= 0 then call message DoorName, LineNumber, "", 1
call hotkey DoorName, LineNumber, GREEN 'Hit Q to Quit or Any Other Key to Continue...'MAGENTA
ans = upper(result)
call checkcarrier
if ans = 'Q' then do
call message DoorName, LineNumber, "", 1
signal main
end
call message DoorsName, LineNumber, "", 1
end
w = w + 1
end
call message DoorName, LineNumber, "", 1
call checkcarrier
signal main
listall:
if curCD == "Please select a CD first" then do
call message DoorName, LineNumber, "", 1
call message DoorName, LineNumber, RED"You must select a CD first!", 1
address command "wait 1"
signal main
end
alldirs = ShowDir(curCD, 'Dir')
totdirs = words(alldirs)
w = 1
if totdirs > 0 then do p = 1 to totdirs
tempdirs.p = word(alldirs, p)
sendname = tempdirs.p
call message DoorName, LineNumber, sendname, 1
if w // LINES = 0 then do
call hotkey DoorName, LineNumber, GREEN 'Hit Q to Quit or Any Other Key to Continue...'YELLOW
ans = upper(result)
call checkcarrier
if ans = 'Q' then do
call message DoorName, LineNumber, "", 1
signal main
end
call message DoorsName, LineNumber, "", 1
end
w = w + 1
end
call message DoorName, LineNumber, MAGENTA, 1
allfiles = ShowDir(curCD, 'File')
totfiles = words(allfiles)
if totfiles > 0 then do p = 1 to totfiles
tempfiles.p = word(allfiles, p)
if right(curcd,1) ~= ":" then slash = "/"
else slash = ""
fileextras = statef(curcd || slash || tempfiles.p)
filesize = word(fileextras, 2)
filecomment = subword(fileextras, 8)
work1 = overlay(tempfiles.p, spaces)
work2 = overlay(filesize, work1, 20)
work3 = overlay(filecomment, work2, 28)
call message DoorName, LineNumber, work3, 1
if w // LINES = 0 then do
call hotkey DoorName, LineNumber, GREEN 'Hit Q to Quit or Any Other Key to Continue...'MAGENTA
ans = upper(result)
call checkcarrier
if ans = 'Q' then do
call message DoorName, LineNumber, "", 1
signal main
end
call message DoorsName, LineNumber, "", 1
end
w = w + 3
end
call message DoorName, LineNumber, "", 1
call checkcarrier
signal main
dload:
if curCD == "Please select a CD first" then do
call message DoorName, LineNumber, "", 1
call message DoorName, LineNumber, RED"You must select a CD first!", 1
address command "wait 1"
signal main
end
dfile = word(ans, 2)
call checkcarrier
if right(curcd,1) ~= ":" then slash = "/"
else slash = ""
dfile = curCD || slash || dfile
if dfile == "" then signal main
if ~Exists(dfile) then do
call message DoorName, LineNumber, "", 1
call message DoorName, LineNumber, RED"The file does not exist!", 1
address command "wait 1"
signal main
end
call SendBinFile DoorName, LineNumber, dfile
call checkcarrier
signal main
syntax:
call message DoorName, LineNumber, "**syntax** in RFSCD in line: " SIGL " Severity: " RC, 1
say "**syntax** in line: " SIGL " Severity: " RC
call message DoorName, LineNumber, "Notify Sysop Immediately!!!!!!", 1
call message DoorName, LineNumber, " ", 1
address command "wait 1"
call quit
ioerr:
call message DoorName, LineNumber, "**IO ERROR** in RFSCD in line: " SIGL " Severity: " RC, 1
say"**IO ERROR** in line: " SIGL " Severity: " RC
call message DoorName, LineNumber, "Notify Sysop Immediately!!!!!!", 1
call message DoorName, LineNumber, " ", 1
address command "wait 1"
call quit
quit:
call Exit_Door DoorName, LineNumber
exit
CHECKCARRIER:
call cdetect doorname,linenumber
if upper(result)="NO CARRIER!" then signal quit
return